<template>
  <div>
    <van-dropdown-menu>
      <van-dropdown-item
        disabled
        v-model="price"
        :options="option1"
        title="综合"
      />
      <van-dropdown-item @change="changePrice" v-model="price" :options="option1" title="价格" />
      <van-dropdown-item @change="changeCategory" v-model="category" :options="filterCategory" title="分类" />
    </van-dropdown-menu>
    <Product v-if="goodsList.length > 0" :goodsList = "goodsList"/>
    <van-empty v-else image="search" description="没有您想要的内容" />
  </div>
</template>

<script>

import Product from "@/components/Product";
export default {
  props: ["goodsList","filterCategory"],
  data() {
    return {
      price: 1,
      category: "1005002",
      option1: [
        { text: "价格由高到低", value: "asc" },
        { text: "价格由低到高", value: "desc"},
      ]
    };
  },
  components: {
    Product,
  },
  created() {},
  mounted() {},
  // beforeUpdate(){
  //     this.filterCategory.map(item=>{
  //         if(item.check){
  //             this.category = item.value;
  //         }
  //     })
  // },
  methods: {
    changeCategory(val){
      this.$emit("changeCategory",val);
    },
    changePrice(val){
      this.$emit("changePrice",val)
    }
  },
};
</script>

<style scoped lang="less">
</style>
